package br.urca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class AproveitamentoPK implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Column(name = "cdalucur", columnDefinition = "VARCHAR(11)")
	private String matricula;
	
	@Column(name = "cddis", columnDefinition = "CHAR(10)")
	private String codDisciplina;
	
	public AproveitamentoPK(){ }

	public AproveitamentoPK(String matricula, String codDisciplina) {
		super();
		this.matricula = matricula;
		this.codDisciplina = codDisciplina;
	}

	public String getMatricula() {
		return matricula;
	}

	public void setMatricula(String matricula) {
		this.matricula = matricula;
	}

	public String getCodDisciplina() {
		return codDisciplina;
	}

	public void setCodDisciplina(String codDisciplina) {
		this.codDisciplina = codDisciplina;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((codDisciplina == null) ? 0 : codDisciplina.hashCode());
		result = prime * result
				+ ((matricula == null) ? 0 : matricula.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AproveitamentoPK other = (AproveitamentoPK) obj;
		if (codDisciplina == null) {
			if (other.codDisciplina != null)
				return false;
		} else if (!codDisciplina.equals(other.codDisciplina))
			return false;
		if (matricula == null) {
			if (other.matricula != null)
				return false;
		} else if (!matricula.equals(other.matricula))
			return false;
		return true;
	}
	
}
